package information;

import java.util.Comparator;

/**
 * Comparator for comparing regions of two jobs.
 * Supports user story 7
 * @author Christian
 *
 */
public class JobRegionComparator implements Comparator<Job> {
	//@requires the jobs, parks and regions not null and are properly populated
	//@ensures that one job is >, =, or < the other job based on regions
	public int compare(Job j1, Job j2) {
		String region1 = j1.getPark().getMyRegion().toLowerCase();
		String region2 = j2.getPark().getMyRegion().toLowerCase();
		return region1.compareTo(region2);
	}

}
